package com.hzsk.lisence.entity;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.web.multipart.MultipartFile;

import javax.persistence.*;
import java.sql.Timestamp;
import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Entity
@Table(name = "software")
public class SoftwareEntity {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column()
    private Integer id;

    @Column(name = "software_logo", columnDefinition = "MEDIUMTEXT NOT NULL  comment '软件图标'")
    private String softwareLogo;

    @Column(name = "software_name", columnDefinition = "varchar(255)  NOT NULL  comment '软件名称'")
    private String softwareName;

    @Column(name = "software_describe", columnDefinition = "varchar(255)  NOT NULL  comment '软件描述'")
    private String softwareDescribe;

    @Column(name = "flag",columnDefinition = "Integer(11) DEFAULT NULL comment '标识 0为正常、1为禁用'")
    @ApiModelProperty(value = "标识 0为正常、1为禁用")
    @JsonIgnore
    private Integer flag;


    @Column(name ="update_time")
    @ApiModelProperty(value = "修改时间")
    @JsonIgnore
    private Timestamp updateTime;

    @Column(name ="create_time",columnDefinition = "datetime DEFAULT NULL  comment '创建时间'")
    @ApiModelProperty(value = "创建时间")
    private Timestamp createTime;

    @Transient
    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
    private Integer operatorUserId;

    @Transient
    private List<SoftwareSonEntity> softwareSons;

    @Transient
    private Integer lisenceNum;

    @Transient
    @JsonIgnore
    private MultipartFile file;
}
